using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor.SceneManagement;
using UnityEngine;


public class BasicAudio : MonoBehaviour
{
    
    public AudioSource audioSource;
    public AudioClip audioClip;
    private void Start()
    {
       
        
    }

    private void Awake()
    {
        AudioController.instance.basicAudioList ??= new List<BasicAudio>();
        AudioController.instance.basicAudioList.Add(this);
        if (audioSource == null)
        {
            
            audioSource = gameObject.AddComponent<AudioSource>();
        }
        SetVolume();
        
    }

    public virtual void SetVolume()
    {
        audioSource.volume = AudioController.instance.master_volume/100f;
            
    }
    public virtual void Play()
    {
        audioSource.PlayOneShot(audioClip);
    }
    
    
}
